package gui.basicchart;

import gui.toolbox.Chart;
import gui.toolbox.Statebar;

import java.awt.BorderLayout;

import javax.swing.JFrame;

import model.listener.NodeListener;

public class BasicChartPanel extends JFrame {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1407280911328461041L;
	BasicChart chart;
	private Statebar statebar = new Statebar();

	public BasicChartPanel(int maxUsers){
		super();
		chart = new BasicChart(maxUsers);
		BorderLayout layout = new BorderLayout();
		this.setLayout(layout);
		this.setTitle("KiBeam");
		this.add(statebar,BorderLayout.PAGE_END);
		this.add(chart,BorderLayout.CENTER);
		
		
		//this.add(body,BorderLayout.EAST);
		//this.setSize(600,600);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		//this.setContentPane(body);
		this.pack();
	}
	
	public void setState(String text){
		statebar.setText(text);
	}
	
	public NodeListener getChartDataListener(){
		return chart;
	}
	
}
